import re, os
from website.website_base import WebSiteBase, FetchQueueItem, WebSiteDb
from bs4 import BeautifulSoup
from lib.log import DBG, INFO, ERROR, EXCEPTION
from lib.sqlite_ext import DBApiExt
from website.homeweb.homeweb import Homeweb


class Qyhhs(Homeweb):
    """
    """
    INDEX_URL = "https://www.qyhhs2.digital"
    DB = f"{os.path.abspath(os.getcwd())}/website/qyhhs/qyhhs.db"
    SAVE_DIR = f"{os.path.abspath(os.getcwd())}/website/qyhhs/page"

    def __init__(self):
        super().__init__()

    @classmethod
    def _class_config(cls):
        """
        获取所有分类首页url列表

        :return:
        """

        class_list = [{"name": "国产精品", "id": 20},
                      {"name": "主播大秀", "id": 21},
                      {"name": "唯美视频", "id": 22},
                      {"name": "口交视频", "id": 23},
                      {"name": "日本有碼", "id": 24},
                      {"name": "日本無碼", "id": 25},
                      {"name": "动漫视频", "id": 26},
                      {"name": "欧美视频", "id": 27}]

        return class_list

    def _parse_class_page_a_list_content(self, soup):
        lis = soup.select(".i_list")
        return lis

